using UnityEngine;
using UnityEngine.UI;

namespace QFramework.RollABall
{
    public class GameUI
    {
        public GameUI()
        {
            // 创建 Canvas
            var canvasGameObj = new CanvasBuilder()
                .RenderMode(RenderMode.ScreenSpaceOverlay)
                .Build();

            // 创建 Text
            var pickUpCountGameObj = new TextBuilder()
                .AddToParent(canvasGameObj)
                .Text("0")
                .Build();

            mPickUpText = pickUpCountGameObj.GetComponent<Text>();
        }

        private Text mPickUpText;

        public void UpdatePickUpCountText(int pickUpCount)
        {
            mPickUpText.text = pickUpCount.ToString();
        }

        public void ShowGameSucceedText()
        {
            mPickUpText.text = "游戏通关";
        }
    }
}